package com.yw.common.core.db;

import java.sql.Connection;
import java.sql.PreparedStatement;

import com.yw.common.core.db.exception.DBCloseException;
import com.yw.common.core.db.exception.DBCommitException;
import com.yw.common.core.db.exception.DBException;
import com.yw.common.core.db.exception.DBOpenException;
import com.yw.common.core.db.exception.DBOpenTransException;
import com.yw.common.core.db.exception.DBRollBackException;

/**
 * 数据库连接接口
 * @author aoshiguchen
 * @time 2015-09-01
 */

public interface IDBConnection {
	
	public Connection open() throws DBOpenException;
	public void close() throws DBCloseException;
	public PreparedStatement prepareStatement(String sql) throws DBException;
	public void openTrans() throws DBOpenTransException;
	public void commit() throws DBCommitException;
	public void rollBack() throws DBRollBackException;
	public boolean isClosed() throws DBException;
	
}
